Find the next smallest palindrome of NΒΆ
Write a python program to find the next smallest palindrome of a specified number.
import sys
def next_smallest_palindrome(N):
for i in range(N + 1, sys.maxsize):
if str(i) == str(i)[::-1]:
return i
# test
print(next_smallest_palindrome(99)) # 101
print(next_smallest_palindrome(1221)) # 1331